﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using VoL.Domain.Common.DTO;
using VoL.Domain.IServices.IPatientFile;
using VOL.Entity.DomainModels;

namespace VOL.WebApi.Controllers
{
    /// <summary>
    /// 评估护理API
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PatientManagementController : ControllerBase
    {
        /// <summary>
        /// 患者服务接口
        /// </summary>
        private readonly IPatientsService patient;
        /// <summary>
        /// 仓储
        /// </summary>
        /// <param name="patient">患者服务接口</param>
        public PatientManagementController(IPatientsService patient)
        {
            this.patient = patient;
        }

        /// <summary>
        /// 检索患者
        /// </summary>
        /// <returns>返回数据</returns>
        [HttpGet]// http://localhost:9991/api/PatientManagement/Getpatients
        public List<Patient> Getpatients()
        {
            return patient.Getpatients();
        }

        /// <summary>
        /// 添加/修改患者入院评估
        /// </summary>
        /// <param name="inAssess">请求</param>
        /// <returns>返回任务</returns>
        [HttpPost]// http://localhost:9991/api/PatientManagement/CreatePatientInAssess
        public Task<int> CreatePatientInAssess([FromBody]InAssess inAssess)
        {
            return patient.CreatePatientInAssess(inAssess);
        }
    }
}
